function [Conditions,ceq] = parameterfun(x,n,Pv,b)
Conditions= zeros(n+2,1) ;
for i=1:n-1
    Conditions(i)= x(n+1)*(Pv(i)*x(i)-Pv(i)-Pv(i+1)*x(i+1)) + b(i);
end    
Conditions(n) =x(n+1)*(Pv(n)*x(n)-Pv(n)-Pv(1)*x(1)) + b(n);
Conditions(n+1) = 0;
for i=1:n
    Conditions(n+1)= Conditions(n+1) -Pv(i)*x(i);
end
Conditions(n+1) = x(n+1)*Conditions(n+1) + x(n+1)+ b(n+1);
Conditions(n+2) = x(n+1)*Pv(1)*x(1) + b(n+2);
ceq=[];
end